<script>
  import store from '@/store/index.js'
	export default {
		onLaunch: function() {
			console.log('App Launch')
		},
		onShow: function() {
			console.log('App Show');
			// this.monitor();
		},
		onHide: function() {
			console.log('App Hide')
		},
    methods: {
      /**
       * 监听蓝牙设备
       */
      monitor() {
        uni.onBLEConnectionStateChange(res => {
          // 该方法回调中可以用于处理连接意外断开等异常情况
          if (!res.connected) {
            store.state.message.messageComponent.error('蓝牙设备已断开')
            store.commit('disconnectDevice');
            location.reload();
          }
        })
      }
    }
	}
</script>

<style>
	/*每个页面公共css */
</style>
